export interface Poetry {
  title: string
  author: string
  content: string
}

const poems: Poetry[] = [
  {
    title: '静夜思',
    author: '李白',
    content: '床前明月光，疑是地上霜。举头望明月，低头思故乡。'
  },
  {
    title: '登鹳雀楼',
    author: '王之涣',
    content: '白日依山尽，黄河入海流。欲穷千里目，更上一层楼。'
  },
  {
    title: '早发白帝城',
    author: '李白',
    content: '朝辞白帝彩云间，千里江陵一日还。两岸猿声啼不住，轻舟已过万重山。'
  },
  {
    title: '满江红',
    author: '岳飞',
    content: '怒发冲冠，凭栏处，潇潇雨歇'
  },
  {
    title: '登高',
    author: '杜甫',
    content: '无边落木萧萧下，不尽长江滚滚来'
  }
]

/**
 * 获取随机的一首诗
 */
export const getRandomPoetry = (): Poetry => {
  const randomIndex = Math.floor(Math.random() * poems.length)
  return poems[randomIndex]
}
